<?php
    session_start();
?>
<html>
    <head>
         <LINK REL=StyleSheet HREF="maintenancePagesCSS.css" TYPE="text/css" />
    </head>
    <body>
    <center>
      <table width="1000" height="535" border="0" background="images/background.jpg">
          <tr>
            <th height="290" scope="col"><center>
              <h3><img src="images/TitleDeleteEmployeeRecord.gif" alt="Delete Employee Record"></h3>
              <?php
        if($_GET['id'])
        {
            $pk = $_GET['id'];
            include "EmployeeDao.php";
            include "Datasource.php";
            include "Employee.php";
            $objEmployeeDAO = new EmployeeDao();
            $objDatasource = new Datasource("localhost", "theanykey", "root", "");
            $objEmployee = new Employee();
           $objEmployee = $objEmployeeDAO->getObject(&$objDatasource, $pk);
           $lastName = $objEmployee->getLastName();
           $firstName = $objEmployee->getFirstName();
           $userRole = $objEmployee->getRole();
           $loginID = $objEmployee->getLoginID();

        ?>
              <form id="frmDeleteEmployee" action="DeleteEmployeeFunct.php" method="post">
                <table class="SelectTable">
                  <tr>
                    <th class="headerCell"> Last Name: </th>
                    <td class="InfoRow" align="center"><?php print("$lastName");?>
                        <input type="hidden" value="<?php print("$lastName");?>" name="lastname" id="lastname" />                    </td>
                  </tr>
                  <tr>
                    <th> First Name: </th>
                    <td class="InfoRow" align="center"><?php print("$firstName");?>
                        <input type="hidden" value="<?php print("$firstName");?>" name="firstname" id="firstname" />                    </td>
                  </tr>
                  <tr>
                    <th> User ID: </th>
                    <td class="InfoRow" align="center"><?php print("$loginID");?>
                        <input type="hidden" value="<?php print("$loginID");?>" name="loginid" id="loginid" />                    </td>
                  </tr>
                  <tr>
                    <th> Role: </th>
                    <td class="InfoRow" align="center"><?php print($userRole);?>
                        <input type="hidden" value="<?php print($userRole);?>" name="role" id="role" />                    </td>
                  </tr>
                </table>
                <br />
                <input type="hidden" value="<?php print $pk; ?>" name="PK" id="PK"/>
                <input name="Submit" type="Submit" value="Submit" />
              </form>
            </center>
              <?php
        }
        else
        {
            print("<span style='color: Red'>There was an error accessing the information..."
            . "<br/>Please go back and try again.<br><i>If the problem persists, contact your system administrator...</i></span>");
        }
        ?>      
		<BR>
		<BR>
		<script src="links.js" language="javascript" type="text/javascript"></script>
        <script type="text/javascript">
            writeEmployeeLinks("SelectEmployee.php", "Select Employee");
        </script></th>
          </tr>
          <tr>
            <th height="237" scope="col">&nbsp;</th>
          </tr>
      </table>
        <h3><br/>
        </h3>
    </center>

    </body>
</html>

